
//初始化分页控件
function initPage(PageId,_total,_pageSize,_pageNumber,callback){
	$("#"+PageId).pagination({
		total:_total,
		pageSize:_pageSize,
		pageNumber:_pageNumber,
		layout:['first','prev','links','next','last','manual','list'],
		beforePageText:'跳转到第',
		afterPageText:'页/共{pages}页',
		onSelectPage:function(pageNumber, pageSize){
			callback(pageNumber,pageSize);
			$(".pagination-num").val(pageNumber);
			
			$(".pagination table tbody").find('.l-btn-text').mouseover(function(){
				$(this).addClass("l-btn-text-Hovel");
			});
			$(".pagination table tbody").find('.l-btn-text').mouseout(function(){
				$(this).removeClass("l-btn-text-Hovel");
			});
		}
	});
	
	$(".pagination table tbody").find('.l-btn-text').mouseover(function(){
		$(this).addClass("l-btn-text-Hovel");
	});
	$(".pagination table tbody").find('.l-btn-text').mouseout(function(){
		$(this).removeClass("l-btn-text-Hovel");
	});
}

function unfoldMenu(pn, cn){
		var p = $('strong.menu-p'), c = $('div.menu-c'), cc = $('div.menu-c-current');
	if(c.index(cn) != c.index(cc)){
		p.removeClass('menu-p-current');
		cc.hide(0, function(){
			$(this).removeAttr('style').removeClass('menu-c-current');
		});
		pn.addClass('menu-p-current');
		cn.show(0, function(){
			$(this).removeAttr('style').addClass('menu-c-current');
		});
	}
}

function menuHandle(){
	$('strong.menu-p').click(function(){
		var pn = $(this), cn = pn.next();
		unfoldMenu(pn, cn);
	});
}

//设置默认下当前展开
function menuCurrent(){
	//取得第一个二级菜单并展开
	var cn = $(".menu-c:first");
	pn = cn.prev();
	unfoldMenu(pn, cn);
	
	/*var idx = $('input.menu-code-index').val(), m, pn, cn, p = $('strong.menu-p'), c = $('div.menu-c'), cc = $('div.menu-c-current');
	if(/c(\d)+/.test(idx)){ //判断c（十进制）条件
		m = $('a[data-service-index="' + idx + '"]').addClass('current');
		cn = m.parents('div.menu-c');
		pn = cn.prev();
		unfoldMenu(pn, cn);
	}*/
}


function changChildWinSize(){
	var ultouchLi4 = $(".gsglzdmain_xiangxiyongyzili_xia");
	var hy =$(".gsglzdmain_sousuok_xia form table").height();
	ultouchLi4.css("height",$(window).height()-119-hy+"px");
	var ultouchLi7 = $(".gsglzdmain_xiangxiyongyzili_xinjiaxia");
	ultouchLi7.css("height",$(window).height()-92+"px");
}

$(function(){
	changChildWinSize();
});
